#include "frmFrontCodImpl.h"
#include <iostream>
#include <sstream>

//
frmFrontCodImpl::frmFrontCodImpl( QWidget * parent, Qt::WFlags f) 
	: QDialog(parent, f)
{
	setupUi(this);
}

void frmFrontCodImpl::on_btnbuscBST_clicked()
{
	invertedindex::InvertedIndex ii;

	std::string strBloque = lineEdit->text().toStdString().c_str();
	char * pEnd;
	unsigned int offset = strtol (strBloque.c_str(),&pEnd,10);
	std::stringstream os (std::stringstream::in | std::stringstream::out);
	ii.printTreeBlock(os, offset);
	std::string aux=os.str();
	char* aux2=aux.c_str();
	textBrowser->setText(aux2);
}

void frmFrontCodImpl::on_btncerr_clicked()
{
	this->close();
}
//

